<?php
require_once ROOT_ADMIN_MODELS.DS.'Models_Base.php';
class Models_Answer extends Models_Base{
	public function __construct(){
		parent::__construct();
		$this->_key="aid";
		$this->_table="answer";
	}
	
	public function getAnswerByqid($qid)
	{
		$sql="	SELECT *
				FROM answer
				WHERE qid = $qid";
		$data = $this->_db->fetchAll($sql,null,Zend_Db::FETCH_OBJ);

		return $data;
	}
	
	public function delAnswerByqid($qid){
		$sql = "DELETE FROM answer WHERE qid = $qid";
		$this->_db->query($sql);
	}
/*
	public function updateAnswer($id,$qtitle)
	{
		$sql = "UPDATE quest SET qtitle = '$qtitle' WHERE qid = $id";
		$this->_db->query($sql);
	}

	public function setstatus($id,$status)
	{
		$sql = "UPDATE typenews SET status = $status WHERE id = $id";
		$this->_db->query($sql);
	}
	
	public function del($id){
		$sql = "DELETE FROM typenews WHERE id = $id";
		$this->_db->query($sql);
	}
	
	public function countnews($id){
		$sql = "SELECT COUNT(id) FROM news WHERE typeNews_id = $id";
		$count = $this->_db->fetchOne($sql);
		return $count;
	}*/
}
